<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../print.css" type="text/css" media="print">
<meta content="ShareAPI,com.adobe.share.api.ShareAPI,addFolder,deleteNode,downloadFile,getNodeDetails,getNodes,getThumbnail,login,logout,shareFile,updateShare,uploadFile" name="keywords">
<title>com.adobe.share.api.ShareAPI</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'ShareAPI - API Documentation';
				var baseRef = '../../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">API Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../index-list.html')" href="../../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../../index.html?com/adobe/share/api/ShareAPI.html&amp;com/adobe/share/api/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;ShareAPI</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class ShareAPI"); titleBar_setSubNav(false,false,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">com.adobe.share.api</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class ShareAPI</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">ShareAPI <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../../../images/inherit-arrow.gif"> flash.events.EventDispatcher</td>
</tr>
</table>
<p></p>
  ShareAPI is the helper class for accessing the Adobe Share API. It 
  provides much of the client-side functionality for applications; 
  for example, logging in and out, uploading files, sharing files, 
  and so on. While many of these functions call functions in the 
  ShareAPINode and ShareAPIUser classes, most of the work is done here. 
  These functions build the requests with the appropriate XML payload 
  and parse the responses.
  <p></p>
<br>
<hr>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#ShareAPI()">ShareAPI</a>(apikey:String, secret:String)</div>
<div class="summaryTableDescription">
   Share API constructor.</div>
</td><td class="summaryTableOwnerCol">ShareAPI</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addFolder()">addFolder</a>(user:<a href="ShareAPIUser.html">ShareAPIUser</a>, folderName:String, folderDescription:String, parentId:String):<a href="../api/ShareAPIToken.html">ShareAPIToken</a>
</div>
<div class="summaryTableDescription">
   Adds a new folder to Share by building a request with an XML payload 
   containing the requisite details.</div>
</td><td class="summaryTableOwnerCol">ShareAPI</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#deleteNode()">deleteNode</a>(user:<a href="ShareAPIUser.html">ShareAPIUser</a>, nodeId:String):<a href="../api/ShareAPIToken.html">ShareAPIToken</a>
</div>
<div class="summaryTableDescription">
   Deletes a file or folder node node by constructing an HTTP request 
   using the DELETE method and the requisite node ID.</div>
</td><td class="summaryTableOwnerCol">ShareAPI</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#downloadFile()">downloadFile</a>(user:<a href="ShareAPIUser.html">ShareAPIUser</a>, nodeId:String):<a href="../api/ShareAPIToken.html">ShareAPIToken</a>
</div>
<div class="summaryTableDescription">
   downloadFile constructs an url request containing the node URL, session information, and 
   user details.</div>
</td><td class="summaryTableOwnerCol">ShareAPI</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getNodeDetails()">getNodeDetails</a>(user:<a href="ShareAPIUser.html">ShareAPIUser</a>, nodeId:String):<a href="../api/ShareAPIToken.html">ShareAPIToken</a>
</div>
<div class="summaryTableDescription">
   Gets the details of the requested node from the Share response.</div>
</td><td class="summaryTableOwnerCol">ShareAPI</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getNodes()">getNodes</a>(user:<a href="ShareAPIUser.html">ShareAPIUser</a>, nodeId:String = null):<a href="../api/ShareAPIToken.html">ShareAPIToken</a>
</div>
<div class="summaryTableDescription">
   Gets a list of nodes (files and folders) in a user's account.</div>
</td><td class="summaryTableOwnerCol">ShareAPI</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getThumbnail()">getThumbnail</a>(user:<a href="ShareAPIUser.html">ShareAPIUser</a>, nodeId:String):<a href="../api/ShareAPIToken.html">ShareAPIToken</a>
</div>
<div class="summaryTableDescription">
   Returns the thumbnail of a document as a stream.</div>
</td><td class="summaryTableOwnerCol">ShareAPI</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#login()">login</a>(user:<a href="ShareAPIUser.html">ShareAPIUser</a>):<a href="../api/ShareAPIToken.html">ShareAPIToken</a>
</div>
<div class="summaryTableDescription">
   login constructs a log in request so the user can login to Share.</div>
</td><td class="summaryTableOwnerCol">ShareAPI</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#logout()">logout</a>(user:<a href="ShareAPIUser.html">ShareAPIUser</a>):<a href="../api/ShareAPIToken.html">ShareAPIToken</a>
</div>
<div class="summaryTableDescription">
   logout logs a user out by ending the current session.</div>
</td><td class="summaryTableOwnerCol">ShareAPI</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#shareFile()">shareFile</a>(user:<a href="ShareAPIUser.html">ShareAPIUser</a>, nodeId:String, users:Array, emailMessage:String, level:int):<a href="../api/ShareAPIToken.html">ShareAPIToken</a>
</div>
<div class="summaryTableDescription">
   Shares an existing file or node with one or more specified users.</div>
</td><td class="summaryTableOwnerCol">ShareAPI</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#updateShare()">updateShare</a>(user:<a href="ShareAPIUser.html">ShareAPIUser</a>, nodeId:String, usersToAdd:Array, usersToRemove:Array, emailMessage:String):<a href="../api/ShareAPIToken.html">ShareAPIToken</a>
</div>
<div class="summaryTableDescription">
   Updates a shared file by adding and removing users with permission to access the file.</div>
</td><td class="summaryTableOwnerCol">ShareAPI</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#uploadFile()">uploadFile</a>(user:<a href="ShareAPIUser.html">ShareAPIUser</a>, file:FileReference, nodeId:String, name:String, description:String, renditions:Boolean, createpdf:Boolean = false):void</div>
<div class="summaryTableDescription">
   Uploads and adds a file to Share by building a request with an XML payload containing 
   the requisite details.</div>
</td><td class="summaryTableOwnerCol">ShareAPI</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="ShareAPI()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">ShareAPI</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function ShareAPI(apikey:String, secret:String)</code><p>
   Share API constructor. Note that the developer must have registered 
   with Share and will need to have an API key and secret to continue.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">apikey</span>:String</code> &mdash; The API key registered for this application
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">secret</span>:String</code> &mdash; The shared secret assigned to this API key
   </td>
</tr>
</table>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="addFolder()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addFolder</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function addFolder(user:<a href="ShareAPIUser.html">ShareAPIUser</a>, folderName:String, folderDescription:String, parentId:String):<a href="../api/ShareAPIToken.html">ShareAPIToken</a></code><p>
   Adds a new folder to Share by building a request with an XML payload 
   containing the requisite details.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">user</span>:<a href="ShareAPIUser.html">ShareAPIUser</a></code> &mdash; The user performing that is executing this action
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">folderName</span>:String</code> &mdash; The name of the new folder
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">folderDescription</span>:String</code> &mdash; The new folder's description. 
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">parentId</span>:String</code> &mdash; The target parent node under which to add this folder. If set to null, the folder is added to the root node.
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../api/ShareAPIToken.html">ShareAPIToken</a></code></td>
</tr>
</table>
</div>
<a name="deleteNode()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">deleteNode</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function deleteNode(user:<a href="ShareAPIUser.html">ShareAPIUser</a>, nodeId:String):<a href="../api/ShareAPIToken.html">ShareAPIToken</a></code><p>
   Deletes a file or folder node node by constructing an HTTP request 
   using the DELETE method and the requisite node ID.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">user</span>:<a href="ShareAPIUser.html">ShareAPIUser</a></code> &mdash; Execute method on behalf of this user
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">nodeId</span>:String</code> &mdash; Node to delete
   
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../api/ShareAPIToken.html">ShareAPIToken</a></code></td>
</tr>
</table>
</div>
<a name="downloadFile()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">downloadFile</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function downloadFile(user:<a href="ShareAPIUser.html">ShareAPIUser</a>, nodeId:String):<a href="../api/ShareAPIToken.html">ShareAPIToken</a></code><p>
   downloadFile constructs an url request containing the node URL, session information, and 
   user details. Note that sig is the MD5 digest of the string formed by 
   concatenating data with the shared secret returned by an authorization token request.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">user</span>:<a href="ShareAPIUser.html">ShareAPIUser</a></code> &mdash; The user who is downloading the file
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">nodeId</span>:String</code> &mdash; The nodeId of the file to download
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../api/ShareAPIToken.html">ShareAPIToken</a></code></td>
</tr>
</table>
</div>
<a name="getNodeDetails()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getNodeDetails</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getNodeDetails(user:<a href="ShareAPIUser.html">ShareAPIUser</a>, nodeId:String):<a href="../api/ShareAPIToken.html">ShareAPIToken</a></code><p>
   Gets the details of the requested node from the Share response.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">user</span>:<a href="ShareAPIUser.html">ShareAPIUser</a></code> &mdash; Execute method on behalf of this user
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">nodeId</span>:String</code> &mdash; Node to get the details about
   
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../api/ShareAPIToken.html">ShareAPIToken</a></code></td>
</tr>
</table>
</div>
<a name="getNodes()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getNodes</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getNodes(user:<a href="ShareAPIUser.html">ShareAPIUser</a>, nodeId:String = null):<a href="../api/ShareAPIToken.html">ShareAPIToken</a></code><p>
   Gets a list of nodes (files and folders) in a user's account. 
   Share returns a substantial amount of detail about each node,
   and getNodes calls functions in ShareAPINode to parse the data.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">user</span>:<a href="ShareAPIUser.html">ShareAPIUser</a></code> &mdash; Execute method on behalf of this user
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">nodeId</span>:String</code> (default = <code>null</code>)<code></code> &mdash; List nodes that are children of this node. If this is null, use user's root node as parent.
   
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../api/ShareAPIToken.html">ShareAPIToken</a></code></td>
</tr>
</table>
</div>
<a name="getThumbnail()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getThumbnail</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getThumbnail(user:<a href="ShareAPIUser.html">ShareAPIUser</a>, nodeId:String):<a href="../api/ShareAPIToken.html">ShareAPIToken</a></code><p>
   Returns the thumbnail of a document as a stream. Note that folders do not have 
   thumbnails, and not all files will have thumbnails.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">user</span>:<a href="ShareAPIUser.html">ShareAPIUser</a></code> &mdash; Execute method on behalf of this user
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">nodeId</span>:String</code> &mdash; Node to get thumbnail of
   
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../api/ShareAPIToken.html">ShareAPIToken</a></code></td>
</tr>
</table>
</div>
<a name="login()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">login</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function login(user:<a href="ShareAPIUser.html">ShareAPIUser</a>):<a href="../api/ShareAPIToken.html">ShareAPIToken</a></code><p>
   login constructs a log in request so the user can login to Share.
   If successful, user object will have its session ID and secret 
   attributes set.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">user</span>:<a href="ShareAPIUser.html">ShareAPIUser</a></code> &mdash; The user to log in
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../api/ShareAPIToken.html">ShareAPIToken</a></code></td>
</tr>
</table>
</div>
<a name="logout()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">logout</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function logout(user:<a href="ShareAPIUser.html">ShareAPIUser</a>):<a href="../api/ShareAPIToken.html">ShareAPIToken</a></code><p>
   logout logs a user out by ending the current session. In this example, 
   the session is ended by constructing an HTTP request using the DELETE 
   method and the current session ID.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">user</span>:<a href="ShareAPIUser.html">ShareAPIUser</a></code> &mdash; The user to log out
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../api/ShareAPIToken.html">ShareAPIToken</a></code></td>
</tr>
</table>
</div>
<a name="shareFile()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">shareFile</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function shareFile(user:<a href="ShareAPIUser.html">ShareAPIUser</a>, nodeId:String, users:Array, emailMessage:String, level:int):<a href="../api/ShareAPIToken.html">ShareAPIToken</a></code><p>
   Shares an existing file or node with one or more specified users. The share level 
   is set by setting level to 0, 1, or 2. For example, this code could take in a 
   value set from a client's user interface, builds an XML payload containing a 
   list of specified users (if any), a message (which can be null), and the share 
   level. It then constructs an HTTP request using the PUT method and the path to 
   the requisite file.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">user</span>:<a href="ShareAPIUser.html">ShareAPIUser</a></code> &mdash; Execute method on behalf of this user
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">nodeId</span>:String</code> &mdash; The file node to share
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">users</span>:Array</code> &mdash; The list of users to share with
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">emailMessage</span>:String</code> &mdash; Optional message to include in email
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">level</span>:int</code> &mdash; 0 for private, 1 for enumerated users, 2 for public access
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../api/ShareAPIToken.html">ShareAPIToken</a></code></td>
</tr>
</table>
</div>
<a name="updateShare()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">updateShare</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function updateShare(user:<a href="ShareAPIUser.html">ShareAPIUser</a>, nodeId:String, usersToAdd:Array, usersToRemove:Array, emailMessage:String):<a href="../api/ShareAPIToken.html">ShareAPIToken</a></code><p>
   Updates a shared file by adding and removing users with permission to access the file. 
   It builds an XML payload containing a list of specified users to add and remove and 
   then constructs an HTTP request using the PUT method and the path to the requisite file.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">user</span>:<a href="ShareAPIUser.html">ShareAPIUser</a></code> &mdash; Execute method on behalf of this user
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">nodeId</span>:String</code> &mdash; File node to the share
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">usersToAdd</span>:Array</code> &mdash; Add these users to the share 
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">usersToRemove</span>:Array</code> &mdash; Remove these users from the share
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">emailMessage</span>:String</code> &mdash; Optional message to include in the email
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../api/ShareAPIToken.html">ShareAPIToken</a></code></td>
</tr>
</table>
</div>
<a name="uploadFile()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">uploadFile</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function uploadFile(user:<a href="ShareAPIUser.html">ShareAPIUser</a>, file:FileReference, nodeId:String, name:String, description:String, renditions:Boolean, createpdf:Boolean = false):void</code><p>
   Uploads and adds a file to Share by building a request with an XML payload containing 
   the requisite details. Note that sig is the MD5 digest of the string formed by 
   concatenating data with the shared secret returned by an authorization token request.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">user</span>:<a href="ShareAPIUser.html">ShareAPIUser</a></code> &mdash; Execute method on behalf of this user
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">file</span>:FileReference</code> &mdash; File to upload
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">nodeId</span>:String</code> &mdash; Upload file using this name
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">name</span>:String</code> &mdash; Description of file. Set to null for none.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">description</span>:String</code> &mdash; Upload file under this folder node. If null, upload to root node.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">renditions</span>:Boolean</code> &mdash; Set to true to generate renditions (thumbnail, flash preview) for this document
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">createpdf</span>:Boolean</code> (default = <code>false</code>)<code></code></td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
